<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ph="http://java.sun.com/jsf/composite/pharmacy">

    <h:body>

        <ui:composition template="/resources/template/template.xhtml">

            <ui:define name="content">
                <h:form>
                    <p:panel header="Reprint" >
                        <f:facet name="header" >
                            <h:outputLabel value="Reprint Sale Bill" ></h:outputLabel>
                            <hr/>
                            <p:commandButton value="Reprint" ajax="false" >
                                <p:printer target="gpBillPreview" ></p:printer>
                            </p:commandButton>
                            
                            <p:commandButton ajax="false" value="Cancel" action="pharmacy_cancel_bill_retail" disabled="#{pharmacyBillSearch.bill.cancelled}"
                                             rendered="#{webUserController.hasPrivilege('PharmacySaleCancel')}">                           
                            </p:commandButton>
                            
                            <p:commandButton accesskey="n" value="New Pharmacy Bill"  
                                           ajax="false" action="pharmacy_bill_retail_sale" 
                                             onclick="onSubmitButton();"
                                            actionListener="#{pharmacySaleController.resetAll()}" 
                                             style="font-size: 18px!important; font-weight: bold!important; float: right"></p:commandButton>

                        </f:facet>


                    </p:panel>



                    <h:panelGroup   id="gpBillPreview"  > 

                        <h:panelGroup   id="gpBillPreviewSingle" >

                            

                        </h:panelGroup>

                        <h:panelGroup id="gpBillPreviewDouble" rendered="#{sessionController.loggedPreference.pharmacyBillPaperType eq 'PosPaper'}"> 

                            <div >
                                <h:panelGroup rendered="#{sessionController.loggedPreference.pharmacyBillPrabodha eq false}" > 
                                    <ph:saleBill bill="#{pharmacyBillSearch.bill}" duplicate="true" ></ph:saleBill>
                                </h:panelGroup>
                            </div>
                            
                            <div >
                                <h:panelGroup rendered="#{sessionController.loggedPreference.pharmacyBillPrabodha eq true}"> 
                                    <ph:saleBill_prabodha bill="#{pharmacyBillSearch.bill}"></ph:saleBill_prabodha>
                                </h:panelGroup>
                            </div>

                        </h:panelGroup>

                        <h:panelGroup id="gpBillPreviewFiveFive" rendered="#{sessionController.loggedPreference.pharmacyBillPaperType eq 'FiveFivePaper'}"> 

                            <div >
                                <h:panelGroup rendered="#{sessionController.loggedPreference.pharmacyBillPrabodha eq false}" > 
                                    <ph:saleBill_five_five bill="#{pharmacyBillSearch.bill}"></ph:saleBill_five_five>
                                </h:panelGroup>
                            </div>

                        </h:panelGroup>

                    </h:panelGroup>


                </h:form>
            </ui:define>



        </ui:composition>

    </h:body>
</html>
